/*
 * @Author: your name
 * @Date: 2020-03-07 21:46:28
 * @LastEditTime: 2020-03-14 17:15:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-ele-env\src\api\RCIM\RCIM-licence.js
 */
import request from '@/utils/request'
import { getToken } from '@/utils/auth'; // get token from cookie
import {
	formatePostParam
} from '@/utils'
const Bas_Url = '/DeclarePermitLst.asmx'

// 许可证申报界面
export function getEnterpriseDeclarePermitLst(query) { // 许可证申报表格数据
  return request({
    url: `${Bas_Url}/getEnterpriseDeclarePermitLst`,
    method: 'post',
    params: query
  })
}

export function getLicenceBaseInfo(query) { // 点击申报获取数据
  return request({
    url: `/DeclareEnterpirseInfoLst.asmx/GetEnterpriseInfo`,
    method: 'post',
    params: query
  })
}

export function getDeclarePermitInfo(id) { // 查看
  return request({
    url: `${Bas_Url}/getDeclarePermitInfo`,
    method: 'post',
    params: { id }
  })
}

export function InsertDeclarePermit(query) {
	query.token = getToken();
	query = formatePostParam(query);
	return request({
		url: `${Bas_Url}/InsertDeclarePermit`,
		method: 'post',
		data: query,
	})
}

export function getEnterpriseStatus(query) {
	return request({
		url: `/SystemDictionary.asmx/getEnterpriseStatus`,
		method: 'post',
		params: query
	}) // .then(res => res.data)
}

export function getEnterpriseType(query) {
  return request({
    url: `/SystemDictionary.asmx/getEnterpriseType`,
    method: 'post',
    params: query
  }) // .then(res => res.data)
}


// 许可证申报统计界面
export function getRadPermitOverdue(query) { // 许可证申报统计表格数据
  return request({
    url: `${Bas_Url}/getRadPermitOverdue`,
    method: 'post',
    params: query
  })
}

export function getNewDeclarePermitInfo(id) { // 许可证申报统计界面许可证图片
  return request({
    url: `${Bas_Url}/getNewDeclarePermitInfo`,
    method: 'post',
    params: {id}
  })
}

export function UpdateDeclarePermit(query) { // 同意或者不同意
	query = formatePostParam(query);
	return request({
		url: `${Bas_Url}/UpdateDeclarePermit`,
		method: 'post',
		data: query
	})
}
